home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 4449 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  797 b 

  1. Path: news.uni-jena.de!news
  2. From: mkt@isun04.inf.uni-jena.de (Tilo Koerbs)
  3. Newsgroups: comp.lang.c++
  4. Subject: ostrstream: Who knows it exectly?
  5. Date: 30 Jan 1996 13:07:39 GMT
  6. Organization: Lehrstuhl fuer Rechnerarchitektur- und kommunikation, FSU Jena
  7. Message-ID: <4el56r$357@fsuj01.rz.uni-jena.de>
  8. Reply-To: mkt@isun04.inf.uni-jena.de
  9. NNTP-Posting-Host: isun15.inf.uni-jena.de
  10.  
  11. Look at this piece of code:
  12.  
  13. ostrstream buf;        // dynamic buffer.
  14. // Fill buf...
  15. buf << ends;        // Append NULL-byte.
  16. char *p = buf.str();    // Freeze buffer.
  17.  
  18. And now the problem: The users must delete the buffer
  19. by there own. But HOW???
  20. This way:    delete p;
  21. Or this way:    delete [] p;
  22.  
  23. Different books give different answers!
  24. Is it implementation dependend?    (I don't think so!)
  25. Or can I do both?        (I don't think so too!)
  26.  
  27.  
  28.